﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.Production
{
    public class Unit : BusinessObject
    {
        public Unit()
        {
            AddRule(new ValidateRequired("UnitCode"));
            AddRule(new ValidateLength("UnitCode", 0, 20));

            AddRule(new ValidateRequired("UnitName"));
            AddRule(new ValidateLength("UnitName", 0, 255));

            AddRule(new ValidateRequired("RestaurantID"));
        }

        public Unit(string unitId, string unitCode, string unitName, string description, string restaurantId, bool isActive)
        {
            UnitID = unitId;
            UnitCode = unitCode;
            UnitName = unitName;
            Description = description;
            RestaurantID = restaurantId;
            IsActive = isActive;
        }

        public string UnitID { get; set; }

        public string UnitCode { get; set; }

        public string UnitName { get; set; }

        public string Description { get; set; }

        public string RestaurantID { get; set; }

        public bool IsActive { get; set; }
    }
}